import { createBrowserRouter, Navigate } from "react-router-dom";
import App from "../App.tsx";
const router = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/login" />,
  },
  {
    path: "/",
    element: <App></App>,
    children: [
      {
        path: "/login",
        lazy: async () => ({
          Component: (await import("@/views/login/index.tsx")).default,
        }),
      },
      {
        path: "/home",
        lazy: async () => ({
          Component: (await import("@/views/home/index.tsx")).default,
        }),
      },
    ],
  },
]);
// export default useRoutes(router)
export default router;
